<?php
namespace app\common\validate;

use think\Validate;

class SkuValidate extends Validate
{
    protected $rule =   [
        'page|页数'     => 'require|integer',
        'limit|条数'    => 'require|integer',
        'id|规格ID'     => 'require|integer',
        'name|名称'     => 'require|length:1,50',
        'field'         => 'require|in:name',
        'value'         => 'require|length:1,50',
    ];
    
    protected $scene = [
        /** admin */
        'show'  => ['id'],
        'add'   => ['name'],
        'list'  => ['page', 'limit'],
        'edit'  => ['id', 'field', 'value'],
    ];
}